<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>初识promise</title>
</head>
<body>
    <script>
        const p=new Promise((resolve,reject)=>{
            console.log('同步');
            setTimeout(() => {
                resolve('你成功了')
                reject('你错了')
                console.log('异步');
            }, 2000);
        })
        console.log(p);
    </script>
</body>
</html>